package movieGandalf.search;

public class ActorNameParam implements SearchParam{
	
	private String actorName;
	
	public ActorNameParam(String actorName){
		this.actorName = actorName;
	}
	
	public String getParam() {
		return "";
	}
	
	public Object getValue(){
		return "" + actorName + "";
	}
	
	public String getJoin(){
		return "INNER JOIN MovieActors AS MovieActorsHelp ON MovieActorsHelp.movieID=MoviesWithData.movieID INNER JOIN (SELECT actorID FROM Actors WHERE actorName LIKE CONCAT('%',?,'%')) AS ActorHelp ON MovieActorsHelp.actorID=ActorHelp.actorID";
	}
	
	public boolean isParamOnJoin(){
		return true;
	}
	
}
